﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL
{
    class Translator
    {
        public static BLL.Role TranslateToAllRole(DAL.Role role)
        {
            BLL.Role Role = new BLL.Role();
            Role.RoleId = role.RoleId;
            Role.RoleName = role.RoleName;
            Role.statusId.StatusId = role.StatusId;
            return Role;
        }
        public static BLL.Department TranslateToAllDepartment(DAL.Department department)
        {

            BLL.Department Department = new BLL.Department();
            Department.DepartmentId = department.DepartmentId;
            Department.DepartmentName = department.DepartmentName;
            return Department;
        }
        public static BLL.User TranslateTosearchuser(int department, string username)
        {
            BLL.User User = new BLL.User();
            User.FirstName = username;
            User.LastName = username;
            User.departmentId.DepartmentId = department;
            return User;
        }
        public static BLL.User TranslateToAllUser(DAL.User user)
        {
            BLL.User User = new BLL.User();
            User.UserId = user.UserId;
            User.FirstName = user.FirstName;
            User.LastName = user.LastName;
            User.departmentId.DepartmentId = user.DepartmentId;
            User.departmentId.DepartmentName = user.Department.DepartmentName;
            User.roleId.RoleId = user.RoleId;
            User.roleId.RoleName = user.Role.RoleName;
            return User;
        }
        public static BLL.User TranslateToUser(DAL.User user)
        {
            BLL.User User = new BLL.User();
            User.UserId = user.UserId;
            User.FirstName = user.FirstName;
            User.LastName = user.LastName;
            User.departmentId.DepartmentId = user.DepartmentId;
            User.roleId.RoleId = user.RoleId;
            return User;
        }
        public static DAL.User TranslateBLLToDAL(BLL.User user)
        {
            DAL.User User = new DAL.User();
            User.FirstName = user.FirstName;
            User.LastName = user.LastName;
            User.DepartmentId = user.departmentId.DepartmentId;
            User.RoleId = user.roleId.RoleId;
            return User;
        }
    }
}
